import Vue from "vue";
import VueRouter from "vue-router";
import ZhuYe from "../views/ZhuYe.vue";
import HomeNav from "../components/HomeNav.vue";
import XiangQing from "../components/XiangQing.vue";
import SearchView from "../components/SearchView.vue";
import HotSearch from "../zujian/HotSearch.vue";
import SheZhi from "../zujian/SheZhi.vue";

Vue.use(VueRouter);

const routes = [
    // 嵌套写法
    {
        path: "/",
        name: "home",
        component: HomeNav,
        children: [{
                path: "",
                name: "home",
                component: ZhuYe,
            },
            {
                path: "fen",
                name: "fen",
                component: () =>
                    import (
                        "../views/FenLei.vue"
                    ),
            },

            {
                path: "wode",
                name: "wode",
                component: () =>
                    import (
                        "../views/WoDe.vue"
                    ),

            },

        ],

    },
    {
        path: "/more",
        name: "more",
        component: () =>
            import ("../components/MoreView.vue"),

    },
    {
        path: "/xiangqing",
        name: "xiangqing",
        component: XiangQing,
    },
    {
        path: "/search",
        name: "search",
        component: SearchView,
    },
    {
        path: "/hotsearch",
        name: "hotsearch",
        component: HotSearch,
    },
    {
        path: "/shezhi",
        name: "shezhi",
        component: SheZhi,
    },
];

const router = new VueRouter({
    routes,
});

export default router;